package yl.hs.bmipfull.daos.production;

import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;
import yl.hs.bmipfull.daos.BaseDao;
import yl.hs.bmipfull.pojo.production.BrickShipOrderEntity;
import yl.hs.bmipfull.pojo.production.BrickShipOrderModel;
import yl.hs.bmipfull.viewmodels.TrayStatisticsVO;

import java.util.List;
import java.util.Map;

/*
 * IBrickShipDao
 * @category
 * @author 谢景广
 * @date 2022-12-13
 */
@Repository
public interface IBrickShipOrderDao extends BaseDao<BrickShipOrderEntity> {
    int queryCountByCondition(@Param("map")Map<String, Object> query, List<Map<String, Object>> filters);

    List<BrickShipOrderEntity> queryListByCondition(@Param("map") Map<String, Object> query, List<Map<String, Object>> filters);

    List<BrickShipOrderModel> queryListByQuery(@Param("map")Map<String, Object> query,@Param("filters") List<Map<String, Object>> filters);

    int queryOrderCountByCondition(@Param("map")Map<String, Object> query, List<Map<String, Object>> filters);
    Integer queryMCountByCondition(@Param("map")Map<String, Object> query, List<Map<String, Object>> filters);
    List<BrickShipOrderModel> queryMPageByCondition(@Param("map")Map<String, Object> query
            ,@Param("filters") List<Map<String, Object>> filters
            ,@Param("hasProductName") Boolean hasProductName);

    List<BrickShipOrderEntity> queryOrderListByCondition(@Param("map")Map<String, Object> query, List<Map<String, Object>> filters);
    List<BrickShipOrderEntity> queryOrderList(@Param("map")Map<String, Object> query);
    Integer updateOrderFreightReviewed(@Param("snList") List<String> orderSnList, String userSN, String userName, boolean review);

    List<BrickShipOrderEntity> queryOrderBySnArray(String[] snArray);

    List<BrickShipOrderEntity> queryOrderByDetailSnArray(@Param("snArray")String[] snArray);

    /**
     * 车辆托盘使用情况汇总
     * @param query
     * @return
     */
    List<TrayStatisticsVO> trayStatistics(@Param("map")Map<String, Object> query);
    List<BrickShipOrderModel> queryListByContractSN(String contractSN);
    BrickShipOrderEntity   findByTruckPlate(String truckPlate,int state);
    Integer updatePrinCount(String sn);
}
